﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ManageEmployees.aspx.vb" Inherits="TWIN_test.ManageEmployees" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Admin-Home</title>
    <style type="text/css">
        p.navigation-bar 
        {
            float:left; 
            list-style:none;
            padding:0;
            width:836px;
            height: 25px;
        }
        p.navigation-bar a {
            text-decoration:none;
            padding:2px 0;
            width:180px;
            background:#000;
            color:#eee;
            float:left;
            text-align:center;
            border-left:1px solid #fff;
        }
        .style1
        {
            float:right;
            text-decoration: none;
        }  
    </style>
</head>

<body background="../../Images/Training-Administrator-Background.gif">
<center>
    <form id="form1" runat="server">
   <div>
    <center style="width:851px; height:1645px; ; text-align: left;">
    <br />
   <font color = white> Welcome to the TWIN System, Admin!</font>
    <a href="../../User_Authentication/Login.aspx" class="style1">Logout</a>
    <p style="background:black;" class="navigation-bar">
        <asp:Button ID="manageWorkshopsButton" runat="server" 
            Text="Manage Training Workshops" Width="199px" />
        <asp:Button ID="manageWorkshopEmployeesButton" runat="server" 
            Text="Manage Training Employees" Width="204px" /> 
        <asp:Button ID="viewProfileButton" runat="server" Text="View Profile" 
            Width="95px" /> 
        <asp:Button ID="createUserButton" runat="server" Text="Create User" 
            Width="115px" />
        </p>
        <center>
     <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="USERNAME" DataMember="DefaultView" DataSourceID="SqlDataSource1" 
            BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="5px" 
            CellPadding="2" CellSpacing="2" AutoGenerateDeleteButton="True" 
                AllowSorting="True" ForeColor="Black" AllowPaging="True">
        <AlternatingRowStyle BorderColor="Black" BorderStyle="Solid" 
            BorderWidth="2px" />
            
        <Columns>
            <asp:BoundField DataField="FIRSTNAME" HeaderText="FIRSTNAME" 
                SortExpression="FIRSTNAME" />
            <asp:BoundField DataField="LASTNAME" HeaderText="LASTNAME" 
                SortExpression="LASTNAME" />
            <asp:BoundField DataField="USERNAME" HeaderText="USERNAME" 
                SortExpression="USERNAME" ReadOnly="True" />
        </Columns>
        <RowStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" />
    </asp:GridView>
    </center>
    </center>
    </div>

     <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString2.ProviderName %>" 
        
        
        SelectCommand="SELECT &quot;FIRSTNAME&quot;, &quot;LASTNAME&quot;, &quot;USERNAME&quot; FROM &quot;INFO&quot; ORDER BY LASTNAME" 
        ConflictDetection="CompareAllValues" 
        DeleteCommand="DELETE FROM &quot;INFO&quot; WHERE &quot;USERNAME&quot; = :original_USERNAME AND &quot;FIRSTNAME&quot; = :original_FIRSTNAME AND &quot;LASTNAME&quot; = :original_LASTNAME" 
        InsertCommand="INSERT INTO &quot;INFO&quot; (&quot;FIRSTNAME&quot;, &quot;LASTNAME&quot;, &quot;USERNAME&quot;) VALUES (:FIRSTNAME, :LASTNAME, :USERNAME)" 
        OldValuesParameterFormatString="original_{0}" 
        UpdateCommand="UPDATE &quot;INFO&quot; SET &quot;FIRSTNAME&quot; = :FIRSTNAME, &quot;LASTNAME&quot; = :LASTNAME WHERE &quot;USERNAME&quot; = :original_USERNAME AND &quot;FIRSTNAME&quot; = :original_FIRSTNAME AND &quot;LASTNAME&quot; = :original_LASTNAME">
         <DeleteParameters>
             <asp:Parameter Name="original_USERNAME" Type="String" />
             <asp:Parameter Name="original_FIRSTNAME" Type="String" />
             <asp:Parameter Name="original_LASTNAME" Type="String" />
         </DeleteParameters>
         <InsertParameters>
             <asp:Parameter Name="FIRSTNAME" Type="String" />
             <asp:Parameter Name="LASTNAME" Type="String" />
             <asp:Parameter Name="USERNAME" Type="String" />
         </InsertParameters>
         <UpdateParameters>
             <asp:Parameter Name="FIRSTNAME" Type="String" />
             <asp:Parameter Name="LASTNAME" Type="String" />
             <asp:Parameter Name="original_USERNAME" Type="String" />
             <asp:Parameter Name="original_FIRSTNAME" Type="String" />
             <asp:Parameter Name="original_LASTNAME" Type="String" />
         </UpdateParameters>
    </asp:SqlDataSource>

   
    
    </form>
    </center> 
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConflictDetection="OverwriteChanges" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" 
        DeleteCommand="DELETE FROM &quot;INFO&quot; WHERE (&quot;USERNAME&quot; = :user)" 
        InsertCommand="INSERT INTO &quot;INFO&quot; (&quot;USERNAME&quot;, &quot;STREETADDRESS&quot;, &quot;CITY&quot;, &quot;STATE&quot;, &quot;ZIPCODE&quot;, &quot;FIRSTNAME&quot;, &quot;LASTNAME&quot;) VALUES (:USERNAME, :STREETADDRESS, :CITY, :STATE, :ZIPCODE, :FIRSTNAME, :LASTNAME)" 
        OldValuesParameterFormatString="original_{0}" 
        ProviderName="<%$ ConnectionStrings:ConnectionString2.ProviderName %>" 
        SelectCommand="SELECT * FROM &quot;INFO&quot; WHERE (&quot;USERNAME&quot; = :USERNAME)" 
        UpdateCommand="UPDATE &quot;INFO&quot; SET &quot;STREETADDRESS&quot; = :STREETADDRESS, &quot;CITY&quot; = :CITY, &quot;STATE&quot; = :STATE, &quot;ZIPCODE&quot; = :ZIPCODE, &quot;FIRSTNAME&quot; = :FIRSTNAME, &quot;LASTNAME&quot; = :LASTNAME WHERE &quot;USERNAME&quot; = :original_USERNAME AND &quot;STREETADDRESS&quot; = :original_STREETADDRESS AND &quot;CITY&quot; = :original_CITY AND &quot;STATE&quot; = :original_STATE AND &quot;ZIPCODE&quot; = :original_ZIPCODE AND &quot;FIRSTNAME&quot; = :original_FIRSTNAME AND &quot;LASTNAME&quot; = :original_LASTNAME">
    
        <InsertParameters>
            <asp:Parameter Name="USERNAME" Type="String" />
            <asp:Parameter Name="STREETADDRESS" Type="String" />
            <asp:Parameter Name="CITY" Type="String" />
            <asp:Parameter Name="STATE" Type="String" />
            <asp:Parameter Name="ZIPCODE" Type="String" />
            <asp:Parameter Name="FIRSTNAME" Type="String" />
            <asp:Parameter Name="LASTNAME" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:Parameter DefaultValue="username" Name="USERNAME" Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="STREETADDRESS" Type="String" />
            <asp:Parameter Name="CITY" Type="String" />
            <asp:Parameter Name="STATE" Type="String" />
            <asp:Parameter Name="ZIPCODE" Type="String" />
            <asp:Parameter Name="FIRSTNAME" Type="String" />
            <asp:Parameter Name="LASTNAME" Type="String" />
            <asp:Parameter Name="original_USERNAME" Type="String" />
            <asp:Parameter Name="original_STREETADDRESS" Type="String" />
            <asp:Parameter Name="original_CITY" Type="String" />
            <asp:Parameter Name="original_STATE" Type="String" />
            <asp:Parameter Name="original_ZIPCODE" Type="String" />
            <asp:Parameter Name="original_FIRSTNAME" Type="String" />
            <asp:Parameter Name="original_LASTNAME" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
</body>

</html>
